package com.zzw.hj30;

import java.util.Arrays;
import java.util.Scanner;

/**
 * @Project: hw_java
 * @Description: 字符串合并处理
 * @Author: zzw
 */
public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNext()) {
            String str = scanner.next() + scanner.next();
            int oddsLength = str.length() / 2;
            int evensLength = str.length() % 2 == 0 ? str.length() / 2 : str.length() / 2 +
                    1;
            char[] odds = new char[oddsLength];
            char[] evens = new char[evensLength];
            int i1 = 0, i2 = 0;
            for (int i = 0; i < str.length(); i++) {
                if (i % 2 == 0) {
                    evens[i1++] = str.charAt(i);
                } else {
                    odds[i2++] = str.charAt(i);
                }
            }
            Arrays.sort(odds);
            Arrays.sort(evens);
            StringBuffer buffer = new StringBuffer();
            i1 = 0;
            i2 = 0;
            for (int i = 0; i < str.length(); i++) {
                if (i % 2 == 0) {
                    buffer.append(evens[i1++]);
                } else {
                    buffer.append(odds[i2++]);
                }
            }
            StringBuffer result = new StringBuffer();
            for (int i = 0; i < buffer.length(); i++) {
                int t = -1;
                char c = buffer.charAt(i);
                if (c >= '0' && c <= '9') {
                    t = c - '0';
                } else if (c >= 'A' && c <= 'F') {
                    t = c - 'A' + 10;
                } else if (c >= 'a' && c <= 'f') {
                    t = c - 'a' + 10;
                }
                if (t != -1) {
                    String s = Integer.toBinaryString(t);
                    while (s.length() < 4) {
                        s = '0' + s;
                    }

                    s = new StringBuffer(s).reverse().toString();
                    result.append(Integer.toHexString(Integer.parseInt(s, 2)).toUpperCase());
                } else {
                    result.append(buffer.charAt(i));
                }
            }
            System.out.println(result);
        }
    }
}